

from rest_framework import serializers
from goods.models import SPUSpecification

# 针对规格表序列化器
class SpecificationModelSerializer(serializers.ModelSerializer):
    spu = serializers.StringRelatedField()
    spu_id = serializers.IntegerField()

    class Meta:
        model = SPUSpecification
        fields = [
            'id',
            'name',
            'spu',
            'spu_id'
        ]